<?php

/**
 * DoctorTimeSlotPlan form.
 *
 * @package    docplus.co.za
 * @subpackage form
 * @author     Fox Matuku
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class DoctorTimeSlotPlanForm extends BaseDoctorTimeSlotPlanForm {

	public function configure() {
		unset(
			$this['created_at'], $this['updated_at']
		);

		// grab the day generated options
		$dayOptions = $this->widgetSchema['day']->getOptions("choices");

		// grab the frequency generated options
		$frequencyOptions = $this->widgetSchema['frequency']->getOptions("choices");

		$this->widgetSchema['doctor_id'] = new sfWidgetFormInputHidden();
		$this->widgetSchema['frequency']->setOption("choices", array_merge(array("" => "Please select a frequency"), $frequencyOptions["choices"]));
		$this->widgetSchema['location_id']->setOption("add_empty", "Please select a location");
		$this->widgetSchema['day']->setOption("choices", array_merge(array("" => "Please select a day"), $dayOptions["choices"]));
		$this->widgetSchema['frequency']->setAttribute("class", "select-box-small");
		$this->widgetSchema['location_id']->setAttribute("class", "select-box-small");
		$this->widgetSchema['day']->setAttribute("class", "select-box-small");

		$this->validatorSchema['location_id'] = new sfValidatorString(array('max_length' => 255, 'required' => true), array('required' => 'The *location* field is required.'));
		$this->validatorSchema['day'] = new sfValidatorString(array('max_length' => 255, 'required' => true), array('required' => 'The *day* field is required.'));
		$this->validatorSchema['time'] = new sfValidatorString(array('max_length' => 255, 'required' => true), array('required' => 'The *time* field is required.'));
	}

}
